<template>
  <div class="box">
    <div v-if="flag==1">
      
      <div class="table">
        <el-table :data="tableData" border style="width: 100%">
          <el-table-column type="index" show-overflow-tooltip label="序号" width="80"></el-table-column>
          <el-table-column prop="place" label="位置信息"></el-table-column>
          <el-table-column prop="time" label="公示时间"></el-table-column>
          

          <el-table-column label="操作" fixed="right">
            <!--  <template slot-scope="scope"> -->
            <template>
              <el-button size="mini" type="primary" @click="flag=2">查看</el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="pages">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage4"
          :page-sizes="[10, 15, 20, 25]"
          :page-size="10"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        ></el-pagination>
      </div>
    </div>
    <div class="landInfo" v-if="flag==2">
      <div class="back">
        <el-button icon="el-icon-back" size="small" @click="flag=1">返回</el-button>
      </div>
      <div class="title">
        <p class="title_one">莲花村片区片块7-1</p>
        <p class="title_little">
          <span>竣工测绘面积公示时间：2018年4月25日</span>
          
        </p>
      </div>
      
      <div class="project_position">
        <div class="project_title">现场公示位置</div>
        <div class="project_img">
          <img src="../../../assets/mapText.png" width="500" height="400" />
        </div>
      </div>
      <div class="project_position">
        <div class="project_title">现场公示照片</div>
        <div class="project_img">
          <el-table :data="imgArr" border style="width: 100%">
            <el-table-column type="index" show-overflow-tooltip label="序号" width="60"></el-table-column>
            <el-table-column prop="name" label="现场照片" width="200"></el-table-column>
            <el-table-column label="操作">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="primary"
                  fixed="left"
                  @click="btnSeeImg(scope.row.name)"
                >查看</el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
    </div>

    <el-dialog :title="title" :visible.sync="seeImgDialog" width="50%">
      <div class="seeImg">
        <img src="../../../assets/mapText.png" width="80%" height="500" />
        <!-- <img :src="imgPath" width="80%" height="500"> -->
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { supervising } from "@/api/jungongAreaGongshi";
export default {
  data() {
    return {
      total:1,
      checked: true,
      flag: 1,
      options: [
        {
          value: "0",
          label: "全部"
        },
        {
          value: "1",
          label: "莲花村片区片块7-1"
        },
        {
          value: "2",
          label: "莲花村片区片块7-2"
        }
      ],
      value: "",
      tableData: [
        {
          date: "",
          name: "",
          address: ""
        },
        {
          date: "",
          name: "",
          address: ""
        }
      ],
      currentPage4: 4,
      title: "",
      seeImgDialog: false,
      imgArr: [
        { name: "外业核查照片1", path: "" },
        { name: "	外业核查照片2", path: "" }
      ],
      needInfo:{
        page:1,
        size:10,
      }
    };
  },
  mounted(){
    this.getData()
  },
  methods: {
    getData(){
      var data={}
      var objArr=this.needInfo
      for (var index in objArr) {
        if(objArr[index]!=''&&objArr[index]!=null){
          data[index]=objArr[index];
        }
      }
      data["projectId"]=localStorage.getItem("projectId")
      supervising(data).then(res=>{
        console.log(res)
        this.tableData=res.data.rows
        this.total=res.data.total
      })
    },
    btnSeeImg(title) {
      this.title = title;
      this.seeImgDialog = true;
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    }
  }
};
</script>

<style scoped>
.box {
  padding: 30px;
}
.display_flex {
  display: flex;
  align-items: center;
}
.box_search .display_flex p {
  font-size: 14px;
  color: #333333;
}
.margin_rignt {
  margin-right: 30px;
}
.table {
  margin: 20px 0px;
}

.landInfo {
  border: 1px solid #efefef;
  box-sizing: border-box;
}
.back {
  margin: 20px;
}
.title_one {
  text-align: center;
  line-height: 40px;
  font-size: 20px;
  color: #444;
  font-weight: bold;
}
.title_little {
  font-size: 13px;
  color: #999;
  margin: 40px 20px 20px 30px;
}
.title .title_little span {
  margin-right: 30px;
}
.project_title {
  background: #f8f8f8;
  height: 50px;
  background: #f8f8f8;
  padding: 0px 30px;
  line-height: 50px;
  color: #48494d;
  font-size: 14px;
  font-weight: bold;
  border-top: 1px solid #efefef;
  border-bottom: 1px solid #efefef;
}
.project_img {
  padding: 30px;
}
.seeImg {
  text-align: center;
}
.project_result {
  padding: 30px;
}
.project_result .display_flex {
  margin-bottom: 20px;
  font-size: 13px;
  color: #444;
  width: 180px;
}
</style>